package net.example.lesson2;

import java.util.concurrent.atomic.AtomicInteger;


/**
 * @author ${user}
 * @version V1.0
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}(用一句话描述该文件做什么)
 * @date ${date}
 */
public class IntegerDemo {
    public static void main(String[] args) {
//        final Integer integer = 1;
        final int a = 121;
        final Integer integer = 121;
        final Integer integer1 = Integer.valueOf(121);
        final Integer integer2 =new Integer(121);
        System.out.println(integer == a);
        System.out.println(integer1  == integer);
        System.out.println(integer1 == integer2);
        System.out.println(integer2  == integer);
        System.out.println(integer2  == a);
        System.out.println(integer1  == a);


        final Integer integer3 = Integer.valueOf(128);
        final Integer integer4 = new Integer(128);
        final Integer integer5 = 128;
        final Integer a1 = 128;
        System.out.println("------------------------");

        System.out.println(integer5 == a1);
        System.out.println(integer3  == integer5);
        System.out.println(integer3 == integer4);
        System.out.println(integer5  == integer4);
        System.out.println(integer4  == a1);


        AtomicInteger atomicInteger = new AtomicInteger();
//        System.out.println(atomicInteger.addAndGet(1));
        System.out.println(atomicInteger.getAndIncrement());
        System.out.println(atomicInteger.decrementAndGet());
    }
}

